<!DOCTYPE html	PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	template="/template/template_layout_lr.xhtml"
	xmlns:s="http://sduept.security.el/func">
	<ui:define name="head">
		<style>
.ui-button, .ui-button span, button.ui-button.ui-state-default span,
	.ui-button.ui-state-default span {
	font-weight: normal
}
.ui-widget-fa {
	font-family: "Microsoft JhengHei";
	font-weight: bold;
	font-size: 1.15em;
}

.ui-commandlink-fa {
	font-family: FontAwesome;
}
#createform .ui-fileupload-content, #editForm .ui-fileupload-content {
	display: none;
}

#createform .ui-fileupload-buttonbar, #editForm .ui-fileupload-buttonbar
	{
	background: white;
	border: none;
}
</style>
	</ui:define>
	<ui:define name="left-box-title">
		管控区域
	</ui:define>
	<ui:define name="left-box-body">
		<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
			<p:commandButton value="是" type="button"
				styleClass="ui-confirmdialog-yes" icon="ui-icon-check" />
			<p:commandButton value="否" type="button"
				styleClass="ui-confirmdialog-no" icon="ui-icon-close" />
		</p:confirmDialog>
		<div class="box-header with-border">
			<h:form id="form1">
				<p:growl id="msgs" showDetail="true" />
				<p:autoComplete placeholder="输入区域首字母可查" id="ctrlArea_id" size="20"
					value="#{alarmMessageReceiverController.ctrlArea}"
					completeMethod="#{alarmMessageReceiverController.completeCtrlArea}"
					scrollHeight="400" style="float:left;">
					<p:ajax update="ctrlArea_id :leftForm:tree" event="itemSelect"
						listener="#{alarmMessageReceiverController.autoComplete}" />
				</p:autoComplete>
				<p:commandButton icon="fa fa-refresh"
					style="margin-left:3px;height:30px;"
					update="ctrlArea_id :leftForm:tree :rightForm:plist"
					actionListener="#{alarmMessageReceiverController.refresh()}" />
			</h:form>
		</div>
		<div class="box-body with-border">
			<h:form id="leftForm">
				<p:tree value="#{alarmMessageReceiverController.areaRoot}"
					var="node" dynamic="true" id="tree" widgetVar="tree" animate="true"
					selectionMode="single" style="border:0">
					<p:ajax event="select" update=":rightForm:plist"
						listener="#{alarmMessageReceiverController.onNodeSelect}" />
					<p:treeNode type="subControlArea" icon="fa fa-home">
						<h:outputText value="#{node}" />
					</p:treeNode>
				</p:tree>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="right-box-title">
		变电站列表
	</ui:define>
	<ui:define name="right-box-body">
		<div>
			<h:form id="rightForm">
				<p:toolbar>
					<f:facet name="left">
						<p:outputLabel value="变电站名称：" style="margin-right:5px;"/>
						<p:autoComplete dropdown="true"
							placeholder="变电站首字母查询" scrollHeight="400" size="18"
							value="#{alarmMessageReceiverController.stationQuery}"
							style="margin-right:15px;"
							completeMethod="#{cimUtilController.completeCimStation}">
						</p:autoComplete>
						<p:outputLabel value="电压等级：" style="margin-right:5px" />
						<h:selectOneMenu value="#{alarmMessageReceiverController.voltage}"
							style="width:100px;height:30px;margin-right:10px">
							<f:selectItems var="vol" value="#{ledgerQueryDataController.standVoltageLevels}" 
								itemValue="#{vol.value}" itemLabel="#{vol.label}"/>
						</h:selectOneMenu>
						<p:outputLabel value="消息类型：" style="margin-right:5px" />
						<h:selectOneMenu value="#{alarmMessageReceiverController.msgTypeQuery}"
							style="width:150px;height:30px;margin-right:10px;">
							<f:selectItems var="item" itemLabel="#{item.description}" itemValue="#{item.id}"
								value="#{alarmMessageReceiverController.msgTypes}" />
						</h:selectOneMenu>
						<p:commandButton icon="ui-icon-search" value="查询"
							actionListener="#{alarmMessageReceiverController.query()}"
							update="rightForm:plist" style="margin-left:5px;" />
					</f:facet>
				</p:toolbar>
				<p:dataTable id="plist" var="station" rowKey="#{station.id}"
					emptyMessage="无记录" rowIndexVar="ite"
					value="#{alarmMessageReceiverController.subStations}"
					lazy="false" rows="20" paginator="true" paginatorPosition="bottom"
					paginatorTemplate="{Customization} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
					rowsPerPageTemplate="20,50,100" >
					<f:facet name="{Customization}">
						<p:outputLabel style="margin-right:20px"
							value="总计：#{alarmMessageReceiverController.subStations.size()}条纪录" />
					</f:facet>
			        <p:column headerText="序号 " style="width:60px;text-align:center">
						<h:outputText value="#{ite+1}" />
					</p:column>
					<p:column headerText="变电站" style="text-align:center;width:10%">
						<h:outputText value="#{station.name}" />
					</p:column>
					<p:column headerText="调管单位" style="text-align:center;width:10%">
						<h:outputText
							value="#{alarmMessageReceiverController.getDispatchUnit(station.id)}" />
					</p:column>
					<p:column headerText="运维单位" style="text-align:center;width:10%">
						<h:outputText
							value="#{alarmMessageReceiverController.getMaintenanceUnit(station.id)}" />
					</p:column>
					<p:column headerText="电压等级" style="text-align:center;width:10%">
						<h:outputText value="#{station.standVoltagelevel}" />
					</p:column>
					<p:column headerText="短信推送人员" style="text-align:center;width:50%">
						<p:repeat var="receiver" value="#{alarmMessageReceiverController.getMsgReceivers(station)}">
							<div style="float:left;width:100%">
								<h:outputText value="#{receiver}"/>
							</div>
						</p:repeat>
					</p:column>
				</p:dataTable>
			</h:form>
		</div>
	</ui:define>
	<ui:define name="contentend">
	</ui:define>
</ui:composition>